import React from 'react'
import {Redirect , Switch} from 'react-router-dom'
import menus from './menus'

const redirectMenus=menus.filter(item=>
    item.redirect
)


function RedirectRouterView() {
    return (
        <Switch>
        {
          redirectMenus.map(item => {
            const Item = <Redirect key={ item.path } exact path={ item.path } to={ item.redirect } />
            
            return Item
          })
        }
      </Switch>
    )
}

export default RedirectRouterView
